var status = -1;
var selectionLog = [];

function start(d, c, b) {
    if (status == 0 && d == 0) {
        qm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        qm.dispose()
    } else {
        if (status == a++) {
            qm.curNodeEventEnd(true);
            qm.setInGameDirectionMode(true, false, false);
            qm.inGameDirectionEvent_SetAdditionalEffectVisibleForInGameDirection2();
            qm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
            qm.setStandAloneMode(true);
            qm.fieldEffect_ProcessOnOffLayer("intro", "Effect/EventEffect.img/2019Halloween/startEff", 0, 0, 0, -50, 0, 4, 0, 0, 0, 0, 1);
            qm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/HofM/act1_5/DemianAttack2", 100);
            qm.inGameDirectionEvent_AskAnswerTime(2100)
        } else {
            if (status === a++) {
                qm.inGameDirectionEvent_AskAnswerTime(1000)
            } else {
                if (status === a++) {
                    qm.effect_Text(["#fn黑体##fs20#2020 Haunted Mansion", "NewItem"], [100, 5000, 4, 0, 90, 1, 4, 3, 300, 150, 0, 0]);
                    qm.inGameDirectionEvent_AskAnswerTime(1000)
                } else {
                    if (status === a++) {
                        qm.effect_Text(["#fn黑体##fs60#Episode.2", "NewItem"], [100, 4000, 4, 0, 170, 1, 4, 3, 300, 150, 0, 0]);
                        qm.inGameDirectionEvent_AskAnswerTime(2300)
                    } else {
                        if (status === a++) {
                            qm.effect_Text(["#fn黑体##fs25#微笑的假面", "NewItem"], [100, 3000, 4, 0, 200, 1, 4, 3, 300, 150, 0, 0]);
                            qm.fieldEffect_PlayFieldSound("Sound/SoundEff.img/HofM/act4/evilS_dem", 100);
                            qm.inGameDirectionEvent_AskAnswerTime(3000)
                        } else {
                            if (status === a++) {
                                qm.fieldEffect_InsertCanvas(0, 0, 0, 0, 0, 2000, 0);
                                qm.inGameDirectionEvent_ForcedFlip15(700, 0, 0, 0, 0);
                                qm.setInGameDirectionMode(false, true, false);
                                qm.setStandAloneMode(false);
                                qm.sendNormalTalk("要想知道#b假面和这所宅子的诅咒#k，就要到#b严禁出入的房间#k去。\r\n通过壁炉，房间就藏在宅子的最上面。", 5, 9062243, false, true)
                            } else {
                                if (status === a++) {
                                    qm.forceStartQuest(100441, "");
                                    qm.OnStartNavigation(993175460, 0, "pt_go993175400", 0);
                                    qm.dispose()
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

function stage0(d, c, b) {
    if (status == 0 && d == 0) {
        qm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        qm.dispose()
    } else {
        if (status == a++) {
            var e = qm.getQuest();
            qm.askYesNo("这个任务的依次对话脚本还没有修复哦。它的脚本位于： #b 脚本/任务/100441.js#k\r\n\r\n如果你有兴趣，欢迎一起来修复！\r\n\r\n那么现在，你要立刻开始这个任务吗？")
        } else {
            if (status == a++) {
                qm.forceStartQuest();
                qm.dispose()
            }
        }
    }
}

function end(d, c, b) {
    if (status == 0 && d == 0) {
        qm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        qm.dispose()
    } else {
        if (status == a++) {
            var e = qm.getQuest();
            qm.askYesNo("这个任务的结束脚本还没有修复哦。它的脚本位于： #b /脚本/任务/#e" + e + "#n.js#k\r\n\r\n如果你有兴趣，欢迎一起来修复！\r\n\r\n那么现在，你要立刻完成这个任务吗？")
        } else {
            if (status == a++) {
                qm.forceCompleteQuest();
                qm.dispose()
            }
        }
    }
};